package com.link2room.rodimus.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by VegetaKo on 2016/11/20.
 */
@Entity
@Table(name = "sys_no", catalog = "")
@DynamicInsert
public class SysNo   extends BaseEntity {
    private String apiServiceNo;
    private String noType;
    private String noPre;
    private Long noValue;

    @Basic
    @Column(name = "api_service_no", nullable = true, length = 3)
    public String getApiServiceNo() {
        return apiServiceNo;
    }

    public void setApiServiceNo(String apiServiceNo) {
        this.apiServiceNo = apiServiceNo;
    }

    @Basic
    @Column(name = "no_type", nullable = true, length = 16)
    public String getNoType() {
        return noType;
    }

    public void setNoType(String noType) {
        this.noType = noType;
    }

    @Basic
    @Column(name = "no_pre", nullable = true, length = 16)
    public String getNoPre() {
        return noPre;
    }

    public void setNoPre(String noPre) {
        this.noPre = noPre;
    }

    @Basic
    @Column(name = "no_value", nullable = true)
    public Long getNoValue() {
        return noValue;
    }

    public void setNoValue(Long noValue) {
        this.noValue = noValue;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SysNo sysNo = (SysNo) o;

        if (apiServiceNo != null ? !apiServiceNo.equals(sysNo.apiServiceNo) : sysNo.apiServiceNo != null) return false;
        if (noType != null ? !noType.equals(sysNo.noType) : sysNo.noType != null) return false;
        if (noPre != null ? !noPre.equals(sysNo.noPre) : sysNo.noPre != null) return false;
        if (noValue != null ? !noValue.equals(sysNo.noValue) : sysNo.noValue != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = apiServiceNo != null ? apiServiceNo.hashCode() : 0;
        result = 31 * result + (noType != null ? noType.hashCode() : 0);
        result = 31 * result + (noPre != null ? noPre.hashCode() : 0);
        result = 31 * result + (noValue != null ? noValue.hashCode() : 0);
        return result;
    }
}
